package com.hm.search.listen;
import com.hm.search.cnstants.MqConstants;
import com.hm.search.service.SearchService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class MqListen {
    @Autowired
    private SearchService hmservice;

    @RabbitListener(queues = MqConstants.HM_INSERT_QUEUE)
    public void MqInsert(Long id){
        hmservice.insert(id);

    }


    @RabbitListener(queues = MqConstants.HM_DELETE_QUEUE)
    public void MqDelete(Long id){
        hmservice.delete(id);
    }
}
